<template>
  <div>
    <div class="tost-box">
      <!-- <img src="../../../../../static/image/tanhao.png"> -->
      <span>您的团队有{{ eunumber }}个计划超时未处理</span>
      <!-- 您的团队有2个计划超时未处理 -->
    </div>
    <Table :columns="columns" :data="pcWorkIndexSupervisorListVO.records" :loading="isLoading"
      :row-class-name="rowClassName" style="margin-top:10px">
      <template slot-scope="{ row }" slot="payYears">
        <span>{{ row.payYear + "/" + row.payYears + row.payintv }}</span>
      </template>
      <template slot-scope="{ row }" slot="wideEndDate">
        <span>{{ row.wideEndDate ? row.wideEndDate.slice(0, 10) : '' }}</span>
      </template>
      <template slot-scope="{ row }" slot="planDate">
        <span>{{ row.planDate ? row.planDate.slice(0, 10) : '' }}</span>
      </template>
      <template slot-scope="{row}" slot="planstatename">
        <span v-if="row.planstatename == '未服务'">
          <Button class="status-error" size="small">{{ row.planstatename }}</Button>
        </span>
        <span v-if="row.planstatename == '服务中'">
          <Button class="status-info" size="small">{{ row.planstatename }}</Button>
        </span>
        <span v-if="row.planstatename == '已完成'">
          <Button class="status-default" size="small">{{ row.planstatename }}</Button>
        </span>
      </template>
      <template slot-scope="{ row }" slot="operate">
        <span class="table-button" @click="forward(row)">查看详情</span>
      </template>
    </Table>

    <!-- <Page :total="ipagination.total" show-sizer show-total style="text-align:right;margin-top:20px"
      @on-change="handleCurrentChange" @on-page-size-change="handleSizeChange"
      :page-size-opts="ipagination.pageSizeOptions" :current="ipagination.index" :page-size="ipagination.pageSize"
      transfer></Page> -->
  </div>
</template>

<script>
import { loadResourcesMixin } from "../../../../util/mixins/loadResourcesMixin";
import { tableChangeMixin } from "../../../../util/mixins/tableChangeMixin";
export default {
  name: "invalid",
  mixins: [ tableChangeMixin],
  data() {
    return {
      mixinData: {
        // tableAxios: "getPCWorkIndex",
      },
      eunumber: 1392,
      columns: [
        {
          title: "序号",
          type: "index",
          align: "center",
          width: 80,
        },
        {
          title: "保单号",
          key: "contNo",
          align: "center",
          width: "190",
        },
        {
          title: "投保人",
          key: "appntName",
          align: "center",
          width: "110",
        },
        {
          title: "应交日",
          key: "payToDay",
          align: "center",
          width: "130",
        },
        {
          title: "宽末日",
          slot: "wideEndDate",
          align: "center",
          width: "140",
        },
        {
          title: "应交次数",
          slot: "payYears",
          align: "center",
          width: "100",
        },
        {
          title: "应收保费",
          key: "premium",
          align: "center",
          width: "150",
        },
        {
          title: "计划工作时间",
          slot: "planDate",
          align: "center",
          width: "150",
        },
        {
          title: "计划工作方式",
          key: "planWorkType",
          align: "center",
          minWidth: 160,
        },
        {
          title: "业务员",
          key: "agentName",
          align: "center",
          width: "160",
        },
        {
          title: "专员",
          key: "attacheName",
          align: "center",
          width: "160",
        },
        {
          title: "操作",
          key: "operate",
          slot: "operate",
          align: "center",
          width: "120",
          fixed: "right",
        },
      ],
      pcWorkIndexSupervisorListVO: {
        records: [
          {
            "planId": "1636094964380086273",
            "workId": "1636094964396863489",
            "contNo": "213202122163056",
            "disposestate": "F",
            "appntName": "李玉花",
            "payToDay": "2023-02-08",
            "payYear": "3",
            "payYears": "3",
            "payintv": "年交",
            "premium": "200000.00",
            "planDate": "2023-03-16 00:00:00",
            "planWorkType": "面访业务员",
            "agentcode": "3130000250",
            "agentName": "武建哲",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-04-09 00:00:00",
            "reagentcode": "6130100003",
            "attacheName": "时林",
            "planstate": "0",
            "planstatename": "未服务"
          },
          {
            "planId": "1636094971187441665",
            "workId": "1636094971195830274",
            "contNo": "321021300156364",
            "disposestate": "F",
            "appntName": "李瑞环",
            "payToDay": "2023-02-14",
            "payYear": "3",
            "payYears": "5",
            "payintv": "年交",
            "premium": "1000.00",
            "planDate": "2023-03-16 00:00:00",
            "planWorkType": "电话联系业务员",
            "agentcode": "8600000004",
            "agentName": "互联金融事业部",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-04-15 00:00:00",
            "reagentcode": "6120000006",
            "attacheName": "李银钰",
            "planstate": "0",
            "planstatename": "未服务"
          },
          {
            "planId": "1638631658304180225",
            "workId": "1658319717543170049",
            "contNo": "212202230617646",
            "disposestate": "Y",
            "appntName": "高凤建",
            "payToDay": "2023-03-19",
            "payYear": "2",
            "payYears": "5",
            "payintv": "年交",
            "premium": "10000.00",
            "planDate": "2023-03-23 00:00:00",
            "planWorkType": "网络联系业务员",
            "agentcode": "3120000224",
            "agentName": "孙巨仑",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-05-18 00:00:00",
            "reagentcode": "6120000008",
            "attacheName": "郭晶",
            "planstate": "1",
            "planstatename": "服务中"
          },
          {
            "planId": "1640999523958677505",
            "workId": "1640999523967066114",
            "contNo": "712202030025656",
            "disposestate": "F",
            "appntName": "杨志嫣",
            "payToDay": "2023-03-31",
            "payYear": "4",
            "payYears": "30",
            "payintv": "年交",
            "premium": "4638.00",
            "planDate": "2023-04-30 00:00:00",
            "planWorkType": "网络联系业务员",
            "agentcode": "8612000029",
            "agentName": "王丹",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-05-30 00:00:00",
            "reagentcode": "6120000002",
            "attacheName": "李斌",
            "planstate": "0",
            "planstatename": "未服务"
          },
          {
            "planId": "1640999524680097793",
            "workId": "1640999524688486402",
            "contNo": "712202030025546",
            "disposestate": "F",
            "appntName": "杨志嫣",
            "payToDay": "2023-03-31",
            "payYear": "4",
            "payYears": "30",
            "payintv": "年交",
            "premium": "1470.14",
            "planDate": "2023-04-30 00:00:00",
            "planWorkType": "网络联系业务员",
            "agentcode": "8612000029",
            "agentName": "王丹",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-05-30 00:00:00",
            "reagentcode": "6120000002",
            "attacheName": "李斌",
            "planstate": "0",
            "planstatename": "未服务"
          },
          {
            "planId": "1646794763030994945",
            "workId": "1676769545117741058",
            "contNo": "112202202458359",
            "disposestate": "Y",
            "appntName": "曹叶婷",
            "payToDay": "2023-05-19",
            "payYear": "2",
            "payYears": "30",
            "payintv": "年交",
            "premium": "7360.00",
            "planDate": "2023-05-12 00:00:00",
            "planWorkType": "电话联系客户",
            "agentcode": "1000004229",
            "agentName": "邱梦如",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-07-18 00:00:00",
            "reagentcode": "6120000008",
            "attacheName": "郭晶",
            "planstate": "1",
            "planstatename": "服务中"
          },
          {
            "planId": "1646066727952293890",
            "workId": "1654375473391947778",
            "contNo": "112202202462529",
            "disposestate": "Y",
            "appntName": "马晟皓",
            "payToDay": "2023-05-20",
            "payYear": "2",
            "payYears": "30",
            "payintv": "年交",
            "premium": "2512.00",
            "planDate": "2023-05-13 00:00:00",
            "planWorkType": "网络联系业务员",
            "agentcode": "1000003720",
            "agentName": "李世维",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-07-19 00:00:00",
            "reagentcode": "6120000002",
            "attacheName": "李斌",
            "planstate": "1",
            "planstatename": "服务中"
          },
          {
            "planId": "1646418670415486978",
            "workId": "1677126652241358850",
            "contNo": "711202030048426",
            "disposestate": "Y",
            "appntName": "李智慧",
            "payToDay": "2023-05-08",
            "payYear": "4",
            "payYears": "10",
            "payintv": "年交",
            "premium": "3884.50",
            "planDate": "2023-05-13 00:00:00",
            "planWorkType": "电话联系客户",
            "agentcode": "8611000028",
            "agentName": "王一波",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-07-07 00:00:00",
            "reagentcode": "6110100001",
            "attacheName": "孙涛",
            "planstate": "1",
            "planstatename": "服务中"
          },
          {
            "planId": "1646794928554315777",
            "workId": "1674698678720245761",
            "contNo": "112202202466349",
            "disposestate": "Y",
            "appntName": "付瑞雪",
            "payToDay": "2023-05-20",
            "payYear": "2",
            "payYears": "30",
            "payintv": "年交",
            "premium": "3983.10",
            "planDate": "2023-05-13 00:00:00",
            "planWorkType": "电话联系客户",
            "agentcode": "1000004225",
            "agentName": "刘玉坤",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-07-19 00:00:00",
            "reagentcode": "6120000008",
            "attacheName": "郭晶",
            "planstate": "1",
            "planstatename": "服务中"
          },
          {
            "planId": "1646794928571785217",
            "workId": "1676769806669602818",
            "contNo": "112202202466459",
            "disposestate": "Y",
            "appntName": "李宇荣",
            "payToDay": "2023-05-20",
            "payYear": "2",
            "payYears": "30",
            "payintv": "年交",
            "premium": "4628.70",
            "planDate": "2023-05-13 00:00:00",
            "planWorkType": "电话联系客户",
            "agentcode": "1000004226",
            "agentName": "白龙",
            "invalidDate": null,
            "invalidDay": null,
            "wideEndDate": "2023-07-19 00:00:00",
            "reagentcode": "6120000008",
            "attacheName": "郭晶",
            "planstate": "1",
            "planstatename": "服务中"
          }]
      },
    };
  },
  created() {
    // this.form.managerSelectType = 1;
  },
  methods: {
    rowClassName(row, index) {
      if (row.disposestate == 'F') return "table-bgc";
      // if (index + this.ipagination.pageSize * this.ipagination.index < this.eunumber) return "table-bgc";
    },
    // 工作状态跳转
    forward(row) {
      row.contno = row.contNo || row.contno;
      row.planid = row.planId || row.planid;
      row.workid = row.workId || row.workid;
      row.agentcode = row.agentCode || row.agentcode;
      row.paytodate = row.payToDay || row.paytodate;
      row.reagentcode = row.reagentCode || row.reagentcode;
      this.$router.push({
          name: "ServiceDetail",
        query: {
          row: row,
          insuranceType: "invalid",
        },
      });
    },
    tableThen(res) {
      this.eunumber = res.data.eunumber;
      this.pcWorkIndexSupervisorListVO = res.data.pcWorkIndexSupervisorListVO;
    },
    updateIpagination(res) {
      let data = res.data.pcWorkIndexSupervisorListVO;
      this.ipagination.total =
        +data.total || (data.total == 0 ? 0 : this.ipagination.total);
      this.ipagination.index = +data.current || this.ipagination.index;
      this.ipagination.pageSize = +data.size || this.ipagination.pageSize;
    },
  },
};
</script>
<style scoped>
.tost-box {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #fff7ea;
  border-radius: 4px;
  color: #ee8623;
  font-size: 14px;
  margin-bottom: 10px;
}

.tost-box>img {
  width: 14px;
  height: 14px;
  margin-right: 10px;
}
</style>
